package com.devinlee.distributedlock.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Redisson配置类
 * <p>
 * Created by devinlee in 2021.11.02
 */
@Configuration
public class RedissonConfig {

    @Bean
    public Redisson redisson() {

        Config config = new Config();
        config.useSingleServer()
                .setAddress("redis://192.168.12.189:6379")
                .setDatabase(0);

        return (Redisson) Redisson.create(config);
    }
}
